package com.supermarket.user.controller;

import com.supermarket.common.core.web.controller.BaseController;
import com.supermarket.common.core.web.domain.AjaxResult;
import com.supermarket.common.core.web.page.TableDataInfo;
import com.supermarket.user.domain.Coupon;
import com.supermarket.user.domain.dto.CouponDto;
import com.supermarket.user.service.CouponService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("coupon")
public class CouponController extends BaseController {
    @Autowired
    private CouponService couponService;
    @RequestMapping("list")
    public TableDataInfo list(CouponDto couponDto) {
        startPage();
        List<Coupon> list = couponService.getCouponList(couponDto);
        return getDataTable(list);
    }
}
